package com.example.sgxs_api.mapper;
import org.apache.ibatis.annotations.*;
import com.example.sgxs_api.domain.UserInfo;

import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public interface UserInfoMapper {

    @Insert("INSERT into user_info(user_account,user_password,user_sex) VALUES(#{user_account},#{user_password},#{user_sex})")
    int saveUser(String user_account,String user_password,String user_sex);

    @Select("select user_id,user_account,user_password,user_name, user_sex,user_email,user_telephone,user_age,user_address,user_identity from user_info where user_account=#{user_account} and user_password=#{user_password}")
    UserInfo selectUser(String user_account,String user_password);

    @Select("select user_id,user_account,user_password,user_name, user_sex,user_email,user_telephone,user_age,user_address,user_identity from user_info where user_account=#{user_account} ")
    UserInfo selectUserById(String user_account);

    @Select("select user_id,user_account,user_password,user_name, user_sex,user_email,user_telephone,user_age,user_address,user_identity from user_info  ")
    List<UserInfo> getAll();
}
